#ifndef _USERSERIAL_H
#define _USERSERIAL_H

#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include "uconfig.h"



typedef enum
{
    Sinit,             
    Sidle,              
    Srcv,              
    Ssend,            
} uartState;
typedef enum
{
    MemA,
    MemB,	
} memorycache;


typedef struct loradata {
	  char        sid[7];
	  char        scode[1];
	  char        pulse[8]; 
	  char        duration[3];
	  char        time[12];
}T_slavedevicememory, *PT_slavedevicememory;

extern char gunstart[MAX_salvedevice][6];
extern char ES_sendbuff[9];
extern PT_slavedevicememory ptmemoryhead;
extern T_slavedevicememory loardevicebuff[MAXloramemorydepth];
extern char* CheckSum(char *buf, int len,char *string);
void VserialTX_task(void *parameter);
int readFromSpiflash(void);
int singleWriteToSpiflash(PT_slavedevicememory pts);
#endif


